package com.imooc.miaosha.config;

import com.imooc.miaosha.filter.RequestDataFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 模块描述: <br>
 * ()
 *
 * @Author: Mr. xyb
 * @Date: 2019/4/17 10:43
 * @since: 1.8.0
 * @version: 1.0.0
 */
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean requestFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new RequestDataFilter());
        registration.addUrlPatterns("/*");
        registration.setName("RequestDataFilter");
        registration.setOrder(1);
        return registration;
    }

}
